package General;


public class Tile {
	private Resource yield;
	private Terrain type;
	private Resources resType;
	private int qty;
	public Tile(Resource res, Terrain ter){
		yield = res;
		type = ter;
		if(res.getFood()>0) {
			resType=Resources.FOOD;
			qty = res.getFood();
		}else if(res.getWood()>0){
			resType=Resources.WOOD;
			qty = res.getWood();
		}
		else if(res.getFavor()>0){
			resType=Resources.FAVOR;
			qty = res.getFavor();
		}else if(res.getGold()>0){
			resType=Resources.GOLD;
			qty = res.getGold();
		}
		else {
			resType = null;
			System.out.println("Bad Tile Constructed");
		}
	}
	public Resource getYield(){
		return yield;
	}
	public Terrain getTerrain(){
		return type;
	}
	public Resources getType(){
		return resType;
	}
	public int getQty(){
		return qty;
	}
	@Override
	public String toString(){
		return type+" "+resType.toString()+"-"+qty;
	}
}